﻿using JNPF.Basics.Models;
using JNPF.Utils;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace JNPF.Basics.Logic
{
    /// <summary>
    /// 订单管理
    /// 版 本：V3.0.0
    /// 版 权：引迈信息技术有限公司（https://www.jnpfsoft.com）
    /// 作 者：JNPF开发平台组
    /// 日 期：2017-12-11 
    /// </summary>
    internal interface OrderIService
    {
        /// <summary>
        /// 列表
        /// </summary>
        /// <param name="requestParam">请求参数</param>
        /// <returns></returns>
        Task<PageResult<OrderEntity>> GetList(PageInput input);
        /// <summary>
        /// 子列表（订单明细）
        /// </summary>
        /// <param name="id">主表Id</param>
        /// <returns></returns>
        Task<List<OrderEntryEntity>> GetOrderEntryList(string id);
        /// <summary>
        /// 子列表（订单收款）
        /// </summary>
        /// <param name="id">主表Id</param>
        /// <returns></returns>
        Task<List<OrderReceivableEntity>> GetOrderReceivableList(string id);
        /// <summary>
        /// 信息（前单、后单）
        /// </summary>
        /// <param name="id">主键值</param>
        /// <param name="method">方法:prev、next</param>
        /// <returns></returns>
        Task<OrderEntity> GetPrevOrNextInfo(string id, string method);
        /// <summary>
        /// 信息
        /// </summary>
        /// <param name="id">主键值</param>
        /// <returns></returns>
        Task<OrderEntity> GetInfo(string id);
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="entity">订单信息</param>
        Task Delete(OrderEntity entity);
        /// <summary>
        /// 创建
        /// </summary>
        /// <param name="entity">订单信息</param>
        /// <param name="orderEntryList">订单明细</param>
        /// <param name="orderReceivableList">订单收款</param>
        Task Create(OrderEntity entity, List<OrderEntryEntity> orderEntryList, List<OrderReceivableEntity> orderReceivableList);
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="entity">订单信息</param>
        /// <param name="orderEntryList">订单明细</param>
        /// <param name="orderReceivableList">订单收款</param>
        Task Update(OrderEntity entity, List<OrderEntryEntity> orderEntryList, List<OrderReceivableEntity> orderReceivableList);
        /// <summary>
        /// 更新
        /// </summary>
        /// <param name="orderEntity">订单信息</param>
        /// <returns></returns>
        Task<int> Update(OrderEntity entity);
    }
}
